package o;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import com.huawei.appgallery.agwebview.api.ui.IWebViewActivityProtocol;
import com.huawei.appgallery.assistantdock.buoydock.webview.request.BuoyWebViewWindowRequest;
import java.util.HashMap;
import java.util.Map;

public class bhc extends bgz implements ciz {
    private azq ˊ = null;
    private View ˋ;
    private String ˎ = null;
    private String ॱ = null;

    public void ॱ(@Nullable Bundle bundle) {
        super.ॱ(bundle);
        if (dof.ॱ(this.ॱ)) {
            Logger.e("HtmlSegment", "url null");
            return;
        }
        ˊ(ContentManager.getInstant().getContext());
        IWebViewActivityProtocol buoyWebViewWindowRequest = new BuoyWebViewWindowRequest();
        buoyWebViewWindowRequest.setUri("buoy_segment_webview");
        this.ॱ = ˏ();
        buoyWebViewWindowRequest.setUrl(this.ॱ);
        this.ˊ = ((azi) fho.ˏ().ˋ("AGWebView").ॱ(azi.class)).ˋ(buoyWebViewWindowRequest.getUri());
        if (this.ˊ != null && this.ˊ.ˊ(this.ॱᐝ, buoyWebViewWindowRequest)) {
            this.ˊ.ॱ(this.ॱᐝ, buoyWebViewWindowRequest);
        }
    }

    private String ˏ() {
        Map hashMap = new HashMap();
        hashMap.put("appId", this.ˎ);
        return baa.ˊ(this.ॱ, hashMap);
    }

    protected void ͺ() {
        Bundle ˊˊ = ˊˊ();
        if (ˊˊ != null) {
            String string = ˊˊ.getString("SEGMENT_URI");
            int indexOf = string.indexOf(124);
            if (indexOf != -1) {
                this.ॱ = string.substring(indexOf + 1);
            }
            this.ˎ = ˊˊ.getString("APPID");
        }
        if (this.ˎ == null) {
            this.ˎ = "";
        }
    }

    public View ˋॱ() {
        if (this.ॱᐝ == null) {
            Logger.e("HtmlSegment", "onCreateView, context == null");
            return null;
        }
        View inflate = LayoutInflater.from(this.ॱᐝ).inflate(beo$j.ॱˎ, null);
        this.ˋ = inflate.findViewById(beo$e.ˋ);
        this.ˊ.ˎ(inflate);
        this.ˊ.ˏ(this.ॱᐝ, null);
        return inflate;
    }

    public void onResume() {
        super.onResume();
        if (this.ॱ != null) {
            if (Logger.ˎ()) {
                Logger.ˏ("HtmlSegment", "onresume load");
            }
            this.ˊ.ʽ(this.ॱ);
            this.ॱ = null;
        }
        this.ˊ.ॱˋ();
    }

    public void onStop() {
        if (Logger.ˎ()) {
            Logger.ˏ("HtmlSegment", "onresume onStop");
        }
        super.onStop();
    }

    public void onDestroy() {
        if (Logger.ˎ()) {
            Logger.ˏ("HtmlSegment", "onresume onDestroy");
        }
        if (this.ˊ != null) {
            this.ˊ.ʽ();
        }
        super.onDestroy();
    }

    public boolean ad_() {
        if (this.ˋ == null || ViewCompat.ˏ(this.ˋ, -1)) {
            return false;
        }
        return true;
    }
}
